package com.shengyuan.manage_os.old.ying.erpm;

import com.shengyuan.manage_os.R;
import com.shengyuan.manage_os.im.ECApplication;
import com.shengyuan.manage_os.old.ying.erpm.tasks.Submit_System_Setting_Data_Task;

import android.os.Bundle;

public class Actual_Form_ZongZhongLiang_2 extends Actual_Form_ZongZhongLiang {

	@Override
	public String MyID() {
		return getClass().getName();
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState, true);
		MainApplication.currentActivity = this;
		setContentView(R.layout.actual_form_zongzhongliang_2);
		InitControls();
		GetSpinnerCar2(Actual_Form_PiZhongLiang.class.getName());
	}
	
//    @Override
//	public boolean onLongClick(View view) {
//    	//super.onLongClick(view);
//		switch (view.getId()) {
//		case R.id.editText_car_onlyread:
//			Utility.HideEditFouce(editText_car);
//			if (Submit_System_Setting_Data_Task.A_ZIYOUSHILUN!=null 
//					&& Submit_System_Setting_Data_Task.A_ZIYOUSHILUN.length>0) {
//				SourceSelectMenu menu = new SourceSelectMenu(editText_car);
//				menu.setArrays(Submit_System_Setting_Data_Task.A_ZIYOUSHILUN);
//				menu.show();
//				menu.setOnPopClickListener(new onPopClickListener());
//			}
//		}
//		return true;
//    }
    
	@Override
	protected void SaveJsonData() {
		try {
			IsJson1 = false; mFinished = 1;
			JsonMyID();
			getZhongLiang();

			getCurrentUser();
			getGPS();
			getMemo();
			JsonPicture();
			JsonPicture_Ext();
			//价格保存
			if (Submit_System_Setting_Data_Task.mID>=0) {
				Double mm = Double.parseDouble(editText_zongzhongliang.getText().toString()) -  Double.parseDouble(editText_pizhongliang.getText().toString()) ;
				String YuSuanJiaGe = Submit_System_Setting_Data_Task.J_GONGCHENGMINGCHENG_GC.getJSONObject(Submit_System_Setting_Data_Task.mID).getString("YuSuanJiaGe");
				int pmm = (int)(mm * Double.parseDouble(YuSuanJiaGe));
				mJson.put( getString(R.string.title_actual_form_yusuanjiage),  pmm);
				mJson.put( getString(R.string.title_actual_form_jiage),  YuSuanJiaGe);
			}
		}catch (Exception e) {
		}
	}
	
	@Override
	protected void SpinnerToEditText(int index) {
		//SetEditValueAndFalse(editText_chexing, index, getString(R.string.title_actual_form_editText_chexing));
		SetEditValueAndFalse(editText_cailiao, index, getString(R.string.title_actual_form_editText_cailiao));
		if (editText_gongyingshang!=null) {
			SetEditValueAndFalse(editText_gongyingshang, index, getString(R.string.title_actual_form_editText_gongyingshang));
		}
		if (editText_buyer!=null) {
			SetEditValueAndFalse(editText_buyer, index, getString(R.string.title_actual_form_editText_buyer));
		}
		if (editText_pizhongliang!=null) {
			SetEditValueAndFalse(editText_pizhongliang, index, getString(R.string.title_actual_form_editText_pizhongliang));
		}
		
	}

}
